home *** CD-ROM | disk | FTP | other *** search
/ FM Towns: Free Software Collection 6 / FM Towns Free Software Collection 6.iso / t_os / et / src / _as.s next >
Text File  |  1993-07-08  |  17KB  |  848 lines

  1. .text
  2.   .align  4
  3. .globl  ___line
  4. ___line:
  5.   pushl %ebp
  6.   pushl %edi
  7.   pushl %esi
  8.   pushl %ebx
  9.   movl  %esp,%ebp
  10.   movl  20(%ebp),%ebx
  11.   movl  (%ebx),%ecx     /* pq_0 = pq_a[0] */
  12.   movl  8(%ebx),%eax    /* pq_2 = pq_a[2] */
  13.   cmpl  %ecx,%eax
  14.   jge   0f              /* if (pq_2 >= pq_0) goto 0f */
  15.   movl  %ecx,8(%ebx)    /* pq_a[2] = pq_0 */
  16.   movl  %eax,(%ebx)     /* pq_a[0] = pq_2 */
  17.   movl  4(%ebx),%ecx    /* pq_1 = pq_a[1] */
  18.   movl  12(%ebx),%eax   /* pq_3 = pq_a[3] */
  19.   movl  %ecx,12(%ebx)   /* pq_a[3] = pq_1 */
  20.   movl  %eax,4(%ebx)    /* pq_a[1] = pq_3 */
  21. 0:
  22.   movl  (%ebx),%ecx     /* pq_0 = pq_a[0] */
  23.   andl  $1,%ecx         /* pq_0 &= 1 */
  24.   sall  $2,%ecx         /* pq_0 <<= 2 */
  25.   movl  24(%ebp),%esi
  26.   sall  %cl,%esi        /* %esi = col << pq_0 */
  27.   movl  (%ebx),%ecx     /* x = pq_a[0] */
  28.   sarl  $1,%ecx         /* x /= 2 */
  29.   movl  4(%ebx),%eax    /* y = pq_a[1] */
  30.   movl  $0x140,%edx
  31.   imull %edx            /* y *= 80*sizeof(VRAM) */
  32.   addl  %ecx,%eax       /* x + y */
  33.   movl  _G_nb+8,%ecx
  34.   testl %ecx,%ecx
  35.   je    0f              /* if (!G_nb.page) goto 0f */
  36.   movl  $0x20000,%ecx
  37. 0:
  38.   addl  %ecx,%eax       /* x+y+(!G_nb.page)?0:OFFSET */
  39.   movl  %eax,%edi
  40.   movl  $80,%ecx
  41.   sall  $2,%ecx         /* y_inc *= sizeof(VRAM) */
  42.   movl  12(%ebx),%eax   /* pq_3 = pq_a[3] */
  43.   subl  4(%ebx),%eax    /* dq = pq_3 - pq_a[1] */
  44.   cmpl  $0,%eax
  45.   jge   0f              /* if (dq >= 0) goto 0f */
  46.   negl  %eax            /* dq -= dq */
  47.   negl  %ecx            /* y_inc -= y_inc */
  48. 0:
  49.   movl  28(%ebp),%edx
  50.   movl  %ecx,28(%ebp)   /* 28(%ebp) = y_inc */
  51.   movl  %eax,%ecx       /* %ecx = dq */
  52.   movl  8(%ebx),%eax    /* pq_2 = pq_a[2] */
  53.   subl  (%ebx),%eax     /* dp = pq_2 - pq_a[0] */
  54.   movl  %eax,20(%ebp)
  55.   movw  %ds,%ax
  56.   movw  %ax,%fs
  57.   movw  $0x120,%ax      /* %ds = 0x120 */
  58.   movw  %ax,%ds
  59.   movl  %edx,%eax       /* %eax = mm */
  60.   movl  20(%ebp),%edx   /* %edx = dp */
  61.   movl  %edi,%ebx       /* %ebx = vram_p */
  62.   movl  %ds:(%ebx),%edi /* %edi = *vram_p */
  63.   cmpl  $0,%eax         /* if (mm==P_SET) */
  64.   je    P_SET           /*   goto P_SET */
  65.   cmpl  $1,%eax         /* if (mm==P_RES) */
  66.   je    P_RES           /*   goto P_RES */
  67.   cmpl  $2,%eax         /* if (mm==P_NEG) */
  68.   je    P_NEG           /*   goto P_NEG */
  69.   jmp   6f  
  70.   .align  2
  71. P_SET:
  72.   orl   %esi,%edi       /* set_bit(v, u) */
  73.   movl  %ecx,%eax
  74.   orl   %edx,%eax
  75.   je    6f              /* if (!(dp|dq)) goto 6f */
  76.   cmpl  $0,%ecx
  77.   jne   3f              /* if (dq) goto 3f */
  78. x_line:
  79.   movl  %edx,%ecx
  80.   movl  24(%esp),%eax   /* %eax = col */
  81.   movl  $4,%edx         /* %edx = sizeof(VRAM) */
  82.   cmpl  $0,%ecx
  83.   jne   0f              /* if (dp) goto 0f */
  84.   jmp   6f
  85.   .align  4
  86. 0:
  87.   shll  $4,%esi         /* u <<= 4 */
  88.   je    1f              /* if (!u) goto 1f */
  89. 2:
  90.   orl   %esi,%edi       /* set_bit(v, u) */
  91.   loop  0b              /* if (--dp) goto 0b */
  92.   jmp   6f
  93.   .align  4
  94. 1:  
  95.   movl  %edi,%ds:(%ebx)
  96.   addl  %edx,%ebx       /* vram_x_inc() */
  97.   movl  %ds:(%ebx),%edi
  98.   movl  %eax,%esi       /* u = col */
  99.   jmp   2b
  100.   .align  4
  101. 3:
  102.   cmpl  $0,%edx         /* if (dp) goto 1f */
  103.   jne   1f
  104. y_line:
  105.   movl  28(%esp),%edx   /* %edx = y_inc */
  106.   cmpl  $0,%ecx
  107.   jne   2f              /* if (dq) goto 2f */
  108.   jmp   6f
  109.   .align  4
  110. 2:
  111.   movl  %edi,%ds:(%ebx)
  112.   addl  %edx,%ebx       /* vram_y_inc() */
  113.   movl  %ds:(%ebx),%edi
  114.   orl   %esi,%edi       /* set_bit(v, u) */
  115.   loop  2b              /* if (dq) goto 2b */
  116.   jmp   6f
  117.   
  118.   .align  4
  119. 1:
  120.   cmpl  %edx,%ecx
  121.   jg    5f              /* if (dq > dp) goto yx_line */
  122. xy_line:
  123.   movl  %ecx,%ebp       /* %ebp = dq */
  124.   movl  %edx,%ecx       /* %ecx = dp */
  125.   movl  %edx,%eax       /* %eax = dp */
  126.   sarl  $1,%eax         /* slope = dp >> 1 */
  127.   cmpl  $0,%ecx         /* if (dp) goto 2f */
  128.   jne   2f
  129.   jmp   6f
  130.   .align  4
  131. 2:  
  132.   addl  %ebp,%eax       /* slope += dq */
  133.   cmpl  %edx,%eax
  134.   jl    3f              /* if (slope < dp) goto 3f */
  135.   subl  %edx,%eax       /* slope -= dp */
  136.   movl  %edi,%ds:(%ebx)
  137.   addl  28(%esp),%ebx   /* vram_y_inc() */
  138.   movl  %ds:(%ebx),%edi
  139. 3:
  140.   shll  $4,%esi
  141.   je    3f
  142. 4:
  143.   orl   %esi,%edi       /* set_bit(v, u) */
  144.   loop  2b              /* if (--dp) goto 2b */
  145.   jmp   6f
  146.   .align  4
  147. 3:
  148.   movl  %edi,%ds:(%ebx)
  149.   addl  $4,%ebx         /* vram_x_inc() */
  150.   movl  %ds:(%ebx),%edi
  151.   movl  24(%esp),%esi
  152.   jmp 4b
  153.  
  154.   .align  4
  155. 5:
  156.   movl  %ecx,%ebp       /* %ebp = dq */
  157.   movl  %ecx,%eax       /* %eax = dq */
  158.   sarl  $1,%eax         /* slope = dq >> 1 */
  159.   cmpl  $0,%ecx
  160.   jne   1f              /* if (dq) goto 1f */
  161.   jmp   6f
  162.   .align  4
  163. 1:
  164.   addl  %edx,%eax       /* slope += dp */
  165.   cmpl  %ebp,%eax
  166.   jl    2f              /* if (slope < dq) goto 2f */
  167.   subl  %ebp,%eax       /* slope -= dq */
  168.   shll  $4,%esi
  169.   je    3f
  170. 2:
  171.   movl  %edi,%ds:(%ebx)
  172.   addl  28(%esp),%ebx   /* vram_y_inc() */
  173.   movl  %ds:(%ebx),%edi
  174.   orl   %esi,%edi       /* set_bit(v, u) */
  175.   loop  1b              /* if (dq) goto 1b */
  176.   jmp   6f
  177.   .align  4
  178. 3:
  179.   movl  %edi,%ds:(%ebx)
  180.   addl  $4,%ebx         /* vram_x_inc() */
  181.   movl  %ds:(%ebx),%edi
  182.   movl  24(%esp),%esi
  183.   jmp 2b
  184.   
  185.   .align  2
  186. P_RES:
  187.   notl  %esi
  188.   andl  %esi,%edi
  189.   notl  %esi
  190.   movl  %ecx,%eax
  191.   orl   %edx,%eax
  192.   je    6f
  193.   cmpl  $0,%ecx
  194.   jne   3f
  195.   movl  %edx,%ecx
  196.   movl  24(%esp),%eax
  197.   movl  $4,%edx
  198.   cmpl  $0,%ecx
  199.   jne   0f
  200.   jmp   6f
  201.   .align  4
  202. 0:
  203.   shll  $4,%esi
  204.   je    1f
  205. 2:
  206.   notl  %esi
  207.   andl  %esi,%edi
  208.   notl  %esi
  209.   loop  0b
  210.   jmp   6f
  211.   .align  4
  212. 1:  
  213.   movl  %edi,%ds:(%ebx)
  214.   addl  %edx,%ebx
  215.   movl  %ds:(%ebx),%edi
  216.   movl  %eax,%esi
  217.   jmp   2b
  218.   .align  2
  219. 3:
  220.   cmpl  $0,%edx
  221.   jne   1f
  222.   movl  28(%esp),%edx
  223.   cmpl  $0,%ecx
  224.   jne   2f
  225.   jmp   6f
  226.   .align  4
  227. 2:
  228.   movl  %edi,%ds:(%ebx)
  229.   addl  %edx,%ebx
  230.   movl  %ds:(%ebx),%edi
  231.   notl  %esi
  232.   andl  %esi,%edi
  233.   notl  %esi
  234.   loop  2b
  235.   jmp   6f
  236.   .align  4
  237. 1:
  238.   cmpl  %edx,%ecx
  239.   jg    5f
  240.   movl  %ecx,%ebp
  241.   movl  %edx,%ecx
  242.   movl  %edx,%eax
  243.   sarl  $1,%eax
  244.   cmpl  $0,%ecx
  245.   jne   2f
  246.   jmp   6f
  247.   .align  4
  248. 2:
  249.   addl  %ebp,%eax
  250.   cmpl  %edx,%eax
  251.   jl    3f
  252.   subl  %edx,%eax
  253.   movl  %edi,%ds:(%ebx)
  254.   addl  28(%esp),%ebx
  255.   movl  %ds:(%ebx),%edi
  256. 3:
  257.   shll  $4,%esi
  258.   je    3f
  259. 4:
  260.   notl  %esi
  261.   andl  %esi,%edi
  262.   notl  %esi
  263.   loop  2b
  264.   jmp   6f
  265.   .align  4
  266. 3:
  267.   movl  %edi,%ds:(%ebx)
  268.   addl  $4,%ebx
  269.   movl  %ds:(%ebx),%edi
  270.   movl  24(%esp),%esi
  271.   jmp   4b
  272.   .align  4
  273. 5:  
  274.   movl  %ecx,%ebp
  275.   movl  %ecx,%eax
  276.   sarl  $1,%eax
  277.   cmpl  $0,%ecx
  278.   jne   1f
  279.   jmp   6f
  280.   .align  4
  281. 1:
  282.   addl  %edx,%eax
  283.   cmpl  %ebp,%eax
  284.   jl    2f
  285.   subl  %ebp,%eax
  286.   shll  $4,%esi
  287.   je    3f
  288. 2:
  289.   movl  %edi,%ds:(%ebx)
  290.   addl  28(%esp),%ebx
  291.   movl  %ds:(%ebx),%edi
  292.   notl  %esi
  293.   andl  %esi,%edi
  294.   notl  %esi
  295.   loop  1b
  296.   jmp   6f
  297.   .align  4
  298. 3:
  299.   movl  %edi,%ds:(%ebx)
  300.   addl  $4,%ebx
  301.   movl  %ds:(%ebx),%edi
  302.   movl  24(%esp),%esi
  303.   jmp   2b
  304.   .align  4
  305. P_NEG:
  306.   xorl  %esi,%edi
  307.   movl  %ecx,%eax
  308.   orl   %edx,%eax
  309.   je    6f
  310.   cmpl  $0,%ecx
  311.   jne   3f
  312.   movl  %edx,%ecx
  313.   movl  24(%esp),%eax
  314.   movl  $4,%edx
  315.   cmpl  $0,%ecx
  316.   jne   0f
  317.   jmp   6f
  318.   .align  4
  319. 0:
  320.   shll  $4,%esi
  321.   je    1f
  322. 2:
  323.   xorl  %esi,%edi
  324.   loop  0b
  325.   jmp   6f
  326.   .align  4
  327. 1:
  328.   movl  %edi,%ds:(%ebx)
  329.   addl  %edx,%ebx
  330.   movl  %ds:(%ebx),%edi
  331.   movl  %eax,%esi
  332.   jmp   2b
  333.   
  334.   .align  4
  335. 3:
  336.   cmpl  $0,%edx
  337.   jne   1f
  338.   movl  28(%esp),%edx
  339.   cmpl  $0,%ecx
  340.   jne   2f
  341.   jmp   6f
  342.   .align  4
  343. 2:
  344.   movl  %edi,%ds:(%ebx)
  345.   addl  %edx,%ebx
  346.   movl  %ds:(%ebx),%edi
  347.   xorl  %esi,%edi
  348.   loop  2b
  349.   jmp   6f
  350.   .align  4
  351. 1:
  352.   cmpl  %edx,%ecx
  353.   jg    5f
  354.   movl  %ecx,%ebp
  355.   movl  %edx,%ecx
  356.   movl  %edx,%eax
  357.   sarl  $1,%eax
  358.   cmpl  $0,%ecx
  359.   jne   2f
  360.   jmp   6f
  361.   .align  4
  362. 2:
  363.   addl  %ebp,%eax
  364.   cmpl  %edx,%eax
  365.   jl    3f
  366.   subl  %edx,%eax
  367.   movl  %edi,%ds:(%ebx)
  368.   addl  28(%esp),%ebx
  369.   movl  %ds:(%ebx),%edi
  370. 3:
  371.   shll  $4,%esi
  372.   je    3f
  373. 4:
  374.   xorl  %esi,%edi
  375.   loop  2b
  376.   jmp   6f
  377.   .align  4
  378. 3:
  379.   movl  %edi,%ds:(%ebx)
  380.   addl  $4,%ebx
  381.   movl  %ds:(%ebx),%edi
  382.   movl  24(%esp),%esi
  383.   jmp   4b
  384.   .align  4
  385. 5:
  386.   movl  %ecx,%ebp
  387.   movl  %ecx,%eax
  388.   sarl  $1,%eax
  389.   cmpl  $0,%ecx
  390.   jne   1f
  391.   jmp   6f
  392.   .align  4
  393. 1:
  394.   addl  %edx,%eax
  395.   cmpl  %ebp,%eax
  396.   jl    2f
  397.   subl  %ebp,%eax
  398.   shll  $4,%esi
  399.   je    3f
  400. 2:
  401.   movl  %edi,%ds:(%ebx)
  402.   addl  28(%esp),%ebx
  403.   movl  %ds:(%ebx),%edi
  404.   xorl  %esi,%edi
  405.   loop  1b
  406.   jmp   6f
  407.   .align  4
  408. 3:
  409.   movl  %edi,%ds:(%ebx)
  410.   addl  $4,%ebx
  411.   movl  %ds:(%ebx),%edi
  412.   movl  24(%esp),%esi
  413.   jmp   2b
  414.   
  415.   .align  4
  416. 6:
  417.   movl  %edi,%ds:(%ebx)
  418.   movw  %fs,%ax
  419.   movw  %ax,%ds
  420.   popl  %ebx
  421.   popl  %esi
  422.   popl  %edi
  423.   popl  %ebp
  424.   ret
  425.  
  426.   .align  4
  427. .globl  ___x_rot
  428. ___x_rot:
  429.   pushl %ebp
  430.   movl  %esp,%ebp
  431.   subl  $16,%esp
  432.   pushl %edi
  433.   pushl %esi
  434.   pushl %ebx
  435.   movl  _G_et,%ebx      /* et_p = G_et */
  436.   movl  _G_nb,%eax
  437.   movl  %eax,-12(%ebp)  /* i = G_nb.edge */
  438.   testl %eax,%eax       /* if (!i) goto 2f */
  439.   je    2f
  440. 1:
  441.   movl  8(%ebx),%eax    /* et_p->y1 */
  442.   imull 12(%ebp)        /* *= l_3 */
  443.   movl  %eax,%esi       /* low */
  444.   movl  %edx,%edi       /* high */
  445.   movl  16(%ebx),%eax   /* et_p->z1 */
  446.   imull 8(%ebp)         /* *= l_2 */
  447.   subl  %esi,%eax       /* subl low */
  448.   sbbl  %edi,%edx       /* subl high+CF */
  449.   testl %eax,%eax       /* if ( >= 0 ) goto 0f */
  450.   jge   0f
  451.   addl  $65535,%eax     /* 負の少数点以下の丸め */
  452. 0:
  453.   shrd  $16,%edx,%eax   /* /= GETA_ET */
  454.   movl  %eax,%ecx
  455.   movl  16(%ebx),%eax   /* et_p->z1 */
  456.   movl  %ecx,16(%ebx)   /* et_p->z1 <== */
  457.   imull 12(%ebp)        /* *= l_3 */
  458.   movl  %eax,%esi
  459.   movl  %edx,%edi
  460.   movl  8(%ebx),%eax    /* et_p->y1 */
  461.   imull 8(%ebp)         /* *= l_2 */
  462.   addl  %esi,%eax       /* addl low */
  463.   adcl  %edi,%edx       /* addl high+CF */
  464.   testl %eax,%eax
  465.   jge   0f
  466.   addl  $65535,%eax
  467. 0:
  468.   shrd  $16,%edx,%eax
  469.   movl  %eax,8(%ebx)    /* et_p->y1 <== */
  470.   movl  12(%ebx),%eax   /* et_p->y2 */
  471.   imull 12(%ebp)        /* *= l_3 */
  472.   movl  %eax,%esi
  473.   movl  %edx,%edi
  474.   movl  20(%ebx),%eax   /* et_p->z2 */
  475.   imull 8(%ebp)         /* *= l_2 */
  476.   subl  %esi,%eax
  477.   sbbl  %edi,%edx
  478.   testl %eax,%eax
  479.   jge   0f
  480.   addl  $65535,%eax
  481. 0:
  482.   shrd  $16,%edx,%eax
  483.   movl  %eax,%ecx
  484.   movl  20(%ebx),%eax   /* et_p->z2 */
  485.   movl  %ecx,20(%ebx)   /* et_p->z2 <== */
  486.   imull 12(%ebp)        /* *= l_3 */
  487.   movl  %eax,%esi
  488.   movl  %edx,%edi
  489.   movl  12(%ebx),%eax   /* et_p->y2 */
  490.   imull 8(%ebp)         /* *= l_2 */
  491.   addl  %esi,%eax
  492.   adcl  %edi,%edx
  493.   testl %eax,%eax
  494.   jge   0f
  495.   addl  $65535,%eax
  496. 0:
  497.   shrd  $16,%edx,%eax
  498.   movl  %eax,12(%ebx)   /* et_p->y2 <== */
  499.   addl  $24,%ebx        /* et_p++ */
  500.   decl  -12(%ebp)       /* i-- */
  501.   jne 1b                /* if (i) goto 1b */
  502. 2:
  503.   movl  _G_f,%eax       /* if (!test_bit(G_f, f_REV)) goto 0f */
  504.   andl  $0x1000000,%eax
  505.   je    0f
  506.   pushl 12(%ebp)
  507.   pushl 8(%ebp)
  508.   pushl $_G_ps+8
  509.   pushl $_G_ps+4
  510.   movl  _G_pm+8,%eax
  511.   subl  _G_pm+4,%eax
  512.   pushl %eax
  513.   pushl $0
  514.   call  _revolution
  515. 0:
  516.   leal  -28(%ebp),%esp
  517.   popl  %ebx
  518.   popl  %esi
  519.   popl  %edi
  520.   leave
  521.   ret
  522.  
  523.   .align  4
  524. .globl  ___y_rot
  525. ___y_rot:
  526.   pushl %ebp
  527.   movl  %esp,%ebp
  528.   subl  $16,%esp
  529.   pushl %edi
  530.   pushl %esi
  531.   pushl %ebx
  532.   movl  _G_et,%ebx
  533.   movl  _G_nb,%eax
  534.   movl  %eax,-12(%ebp)
  535.   testl %eax,%eax
  536.   je    2f
  537. 1:
  538.   movl  16(%ebx),%eax
  539.   imull 12(%ebp)
  540.   movl  %eax,%esi
  541.   movl  %edx,%edi
  542.   movl  (%ebx),%eax
  543.   imull 8(%ebp)
  544.   subl  %esi,%eax
  545.   sbbl  %edi,%edx
  546.   testl %eax,%eax
  547.   jge   0f
  548.   addl  $65535,%eax
  549. 0:
  550.   shrd  $16,%edx,%eax
  551.   movl  %eax,%ecx
  552.   movl  (%ebx),%eax
  553.   movl  %ecx,(%ebx)
  554.   imull 12(%ebp)
  555.   movl  %eax,%esi
  556.   movl  %edx,%edi
  557.   movl  16(%ebx),%eax
  558.   imull 8(%ebp)
  559.   addl  %esi,%eax
  560.   adcl  %edi,%edx
  561.   testl %eax,%eax
  562.   jge   0f
  563.   addl  $65535,%eax
  564. 0:
  565.   shrd  $16,%edx,%eax
  566.   movl  %eax,16(%ebx)
  567.   movl  20(%ebx),%eax
  568.   imull 12(%ebp)
  569.   movl  %eax,%esi
  570.   movl  %edx,%edi
  571.   movl  4(%ebx),%eax
  572.   imull 8(%ebp)
  573.   subl  %esi,%eax
  574.   sbbl  %edi,%edx
  575.   testl %eax,%eax
  576.   jge   0f
  577.   addl  $65535,%eax
  578. 0:
  579.   shrd  $16,%edx,%eax
  580.   movl  %eax,%ecx
  581.   movl  4(%ebx),%eax
  582.   movl  %ecx,4(%ebx)
  583.   imull 12(%ebp)
  584.   movl  %eax,%esi
  585.   movl  %edx,%edi
  586.   movl  20(%ebx),%eax
  587.   imull 8(%ebp)
  588.   addl  %esi,%eax
  589.   adcl  %edi,%edx
  590.   testl %eax,%eax
  591.   jge   0f
  592.   addl  $65535,%eax
  593. 0:
  594.   shrd  $16,%edx,%eax
  595.   movl  %eax,20(%ebx)
  596.   addl  $24,%ebx
  597.   decl  -12(%ebp)
  598.   jne 1b
  599. 2:
  600.   movl  _G_f,%eax
  601.   andl  $0x1000000,%eax
  602.   je    0f
  603.   pushl 12(%ebp)
  604.   pushl 8(%ebp)
  605.   pushl $_G_ps
  606.   pushl $_G_ps+8
  607.   pushl $0
  608.   movl  _G_pm+8,%eax
  609.   subl  _G_pm+4,%eax
  610.   pushl %eax
  611.   call  _revolution
  612. 0:
  613.   leal  -28(%ebp),%esp
  614.   popl  %ebx
  615.   popl  %esi
  616.   popl  %edi
  617.   leave
  618.   ret
  619.  
  620.   .align  4
  621. .globl  ___z_rot
  622. ___z_rot:
  623.   pushl %ebp
  624.   movl  %esp,%ebp
  625.   subl  $16,%esp
  626.   pushl %edi
  627.   pushl %esi
  628.   pushl %ebx
  629.   movl  _G_et,%ebx
  630.   movl  _G_nb,%eax
  631.   movl  %eax,-12(%ebp)
  632.   testl %eax,%eax
  633.   je    2f
  634. 1:
  635.   movl  8(%ebx),%eax
  636.   imull 12(%ebp)
  637.   movl  %eax,%esi
  638.   movl  %edx,%edi
  639.   movl  (%ebx),%eax
  640.   imull 8(%ebp)
  641.   subl  %esi,%eax
  642.   sbbl  %edi,%edx
  643.   testl %eax,%eax
  644.   jge   0f
  645.   addl  $65535,%eax
  646. 0:
  647.   shrd  $16,%edx,%eax
  648.   movl  %eax,%ecx
  649.   movl  (%ebx),%eax
  650.   movl  %ecx,(%ebx)
  651.   imull 12(%ebp)
  652.   movl  %eax,%esi
  653.   movl  %edx,%edi
  654.   movl  8(%ebx),%eax
  655.   imull 8(%ebp)
  656.   addl  %esi,%eax
  657.   adcl  %edi,%edx
  658.   testl %eax,%eax
  659.   jge   0f
  660.   addl  $65535,%eax
  661. 0:
  662.   shrd  $16,%edx,%eax
  663.   movl  %eax,8(%ebx)
  664.   movl  12(%ebx),%eax
  665.   imull 12(%ebp)
  666.   movl  %eax,%esi
  667.   movl  %edx,%edi
  668.   movl  4(%ebx),%eax
  669.   imull 8(%ebp)
  670.   subl  %esi,%eax
  671.   sbbl  %edi,%edx
  672.   testl %eax,%eax
  673.   jge   0f
  674.   addl  $65535,%eax
  675. 0:
  676.   shrd  $16,%edx,%eax
  677.   movl  %eax,%ecx
  678.   movl  4(%ebx),%eax
  679.   movl  %ecx,4(%ebx)
  680.   imull 12(%ebp)
  681.   movl  %eax,%esi
  682.   movl  %edx,%edi
  683.   movl  12(%ebx),%eax
  684.   imull 8(%ebp)
  685.   addl  %esi,%eax
  686.   adcl  %edi,%edx
  687.   testl %eax,%eax
  688.   jge   0f
  689.   addl  $65535,%eax
  690. 0:
  691.   shrd  $16,%edx,%eax
  692.   movl  %eax,12(%ebx)
  693.   addl  $24,%ebx
  694.   decl  -12(%ebp)
  695.   jne 1b
  696. 2:
  697.   movl  _G_f,%eax
  698.   andl  $0x1000000,%eax
  699.   je    0f
  700.   pushl 12(%ebp)
  701.   pushl 8(%ebp)
  702.   pushl $_G_ps
  703.   pushl $_G_ps+4
  704.   pushl $0
  705.   pushl $0
  706.   call  _revolution
  707. 0:
  708.   leal  -28(%ebp),%esp
  709.   popl  %ebx
  710.   popl  %esi
  711.   popl  %edi
  712.   leave
  713.   ret
  714.  
  715.   .align  4
  716. .globl  ___cul_r
  717. ___cul_r:
  718.   pushl   %ebp
  719.   pushl   %edi
  720.   pushl   %esi
  721.   pushl %ebx
  722.   movl  %esp,%ebp
  723.   movl  $_G_mv,%ebx
  724.   xorl  %esi,%esi         /* i = 0 */
  725. 0:
  726.   movl  8(%ebx,%esi),%eax /* G_mv[i].z */
  727.   movl  24(%ebp),%edi
  728.   sall  $4,%edi
  729.   movl  8(%ebx,%edi),%edx /* G_mv[min_i].z */
  730.   subl  %edx,%eax         /* G_mv[i].z - G_mv[min_i].z */
  731.   imull 28(%ebp)          /* *= r_d */
  732.   idivl 32(%ebp)          /* /= z_d */
  733.   movl  24(%ebp),%edi
  734.   sall  $4,%edi
  735.   movswl  14(%ebx,%edi),%edx
  736.   addl  %edx,%eax         /* += G_mv[min_i].r */
  737.   movw  %ax,14(%ebx,%esi) /* G_mv[i].r <== */
  738.   movl  %esi,%eax         /* &G_mv[i] */
  739.   addl  $16,%esi          /* += sizeof(MOVE) */
  740.   cmpw  $255,12(%ebx,%eax)/* if (G_mv[i].key == EOK) break; */
  741.   jne 0b
  742. 1:
  743.   popl  %ebx
  744.   popl  %esi
  745.   popl  %edi
  746.   popl  %ebp
  747.   ret
  748.  
  749.   .align  4
  750. .globl  ___clip_z1
  751. ___clip_z1:
  752.   pushl %ebp
  753.   pushl %edi
  754.   pushl %esi
  755.   pushl %ebx
  756.   movl  %esp,%ebp
  757.   movl  20(%ebp),%ebx     /* &a[0] */
  758.   movl  24(%ebp),%eax     /* z_view */
  759.   subl  16(%ebx),%eax     /* z_view-a[4] */
  760.   testl %eax,%eax
  761.   jge   0f
  762.   addl  $65535,%eax
  763. 0:
  764.   sarl  $16,%eax          /* /= GETA_ET */
  765.   movl  4(%ebx),%edx
  766.   subl  (%ebx),%edx
  767.   imull %edx              /* *= (a[1]-a[0]) */
  768.   movl  20(%ebx),%ecx
  769.   subl  16(%ebx),%ecx
  770.   idivl %ecx              /* /= (a[5]-a[4]) */
  771.   sall  $16,%eax          /* *= GETA_ET */
  772.   addl  (%ebx),%eax       /* += a[0] */
  773.   movl  %eax,(%ebx)       /* a[0] <== */
  774.   movl  24(%ebp),%eax
  775.   subl  16(%ebx),%eax
  776.   testl %eax,%eax
  777.   jge   0f
  778.   addl  $65535,%eax
  779. 0:
  780.   sarl  $16,%eax
  781.   movl  12(%ebx),%edx
  782.   subl  8(%ebx),%edx
  783.   imull %edx
  784.   movl  20(%ebx),%ecx
  785.   subl  16(%ebx),%ecx
  786.   idivl %ecx
  787.   sall  $16,%eax
  788.   addl  8(%ebx),%eax
  789.   movl  %eax,8(%ebx)
  790.   movl  24(%ebp),%eax
  791.   movl  %eax,16(%ebx)
  792.   popl  %ebx
  793.   popl  %esi
  794.   popl  %edi
  795.   popl  %ebp
  796.   ret
  797.  
  798.   .align  4
  799. .globl  ___clip_z2
  800. ___clip_z2:
  801.  
  802.   pushl %ebp
  803.   pushl %edi
  804.   pushl %esi
  805.   pushl %ebx
  806.   movl  %esp,%ebp
  807.   movl  20(%ebp),%ebx
  808.   movl  24(%ebp),%eax
  809.   subl  20(%ebx),%eax
  810.   testl %eax,%eax
  811.   jge   0f
  812.   addl  $65535,%eax
  813. 0:
  814.   sarl  $16,%eax
  815.   movl  (%ebx),%edx
  816.   subl  4(%ebx),%edx
  817.   imull %edx
  818.   movl  16(%ebx),%ecx
  819.   subl  20(%ebx),%ecx
  820.   idivl %ecx
  821.   sall  $16,%eax
  822.   addl  4(%ebx),%eax
  823.   movl  %eax,4(%ebx)
  824.   movl  24(%ebp),%eax
  825.   subl  20(%ebx),%eax
  826.   testl %eax,%eax
  827.   jge   0f
  828.   addl  $65535,%eax
  829. 0:
  830.   sarl  $16,%eax
  831.   movl  8(%ebx),%edx
  832.   subl  12(%ebx),%edx
  833.   imull %edx
  834.   movl  16(%ebx),%ecx
  835.   subl  20(%ebx),%ecx
  836.   idivl %ecx
  837.   sall  $16,%eax
  838.   addl  12(%ebx),%eax
  839.   movl  %eax,12(%ebx)
  840.   movl  24(%ebp),%eax
  841.   movl  %eax,20(%ebx)
  842.   popl  %ebx
  843.   popl  %esi
  844.   popl  %edi
  845.   popl  %ebp
  846.   ret
  847.         
  848.